<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="icon" href="../img/favicon.ico">
    <script src="../plugins/echarts/echarts.js"></script>
</head>
<body>
    <div id="main" style="width: 900px;height: 400px"></div>

<script>
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    // 指定图表的配置项和数据
    var option = {
        title: {
            text: 'ECharts 入门示例'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            data:['销量','销售额','单价']
        },
        series: [{
            name: '销量',
            type: 'pie',
            center: ['40%', '50%'],
            data: [
                {value:10,name:"衬衫"},
                {value:100,name:"羊毛衫"}]
            },
            {
                name: '盈利额',
                type: 'pie',
                center: ['80%', '50%'],
                data: [
                    {value:900,name:"衬衫"},
                    {value:300,name:"羊毛衫"}]
            }
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
</html>